﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DemoTest.Bll.Handlers;
using Nido.Common.BackEnd;
using DemoTest.Bll.Models;
using EntityFramework.Extensions;

namespace DemoTestApplication.UserControls
{
    public partial class JustStudentList : System.Web.UI.UserControl
    {
        StudentHandler handlerStudent = new StudentHandler();
        protected void Page_Load(object sender, EventArgs e)
        {
            GenericResponse<IEnumerable<Student>> response = handlerStudent.Include("HomeAddress").GetAllGeneric();
            if (response.Successful)
            {
                this.GridView1.DataSource = response.Result.ToList();
                this.GridView1.DataBind();
            }
        }
    }
}